package RJZ.Rainbow.Dao;

import RJZ.Rainbow.entity.Order;
import org.apache.ibatis.annotations.*;

@Mapper
public interface OrderDao {

    @Insert("INSERT INTO box_order(table_id,input,chequer_id) values(#{orderid},#{inputtime},#{chequerid})")
    void OrderInput(@Param("orderid") String orderid,
                    @Param("inputtime") String inputtime,
                    @Param("chequerid") int chequerid
                    );
    @Select("SELECT * From box_order WHERE chequer_id=#{chequerid} and output=0")
    Order GetOrderByDoor(@Param("chequerid") int chequerid);

    @Update("UPDATE box_order set output=#{outputtime} WHERE table_id=#{orderid}")
    void OrderOutput(@Param("outputtime")String outputtime,@Param("orderid")String orderid);

    @Update("UPDATE box_order set input=#{inputtime} WHERE table_id=#{orderid}")
    void OrderMailIn(@Param("inputtime")String inputtime,@Param("orderid")String orderid);

    @Select("SELECT * From box_order WHERE table_id=#{orderid}")
    Order GetOrderByID(@Param("orderid")String orderid);


}
